if (isSpinner)
this._spinner.play();
- if (!animate)
+ if (!animate) {
actor.opacity = 255;
- else
+ } else {
actor.ease({
opacity: 255,
duration: DEFAULT_BUTTON_WELL_ANIMATION_TIME,
delay: DEFAULT_BUTTON_WELL_ANIMATION_DELAY,
mode: Clutter.AnimationMode.LINEAR
});
+ }
}
this._defaultButtonWellActor = actor;
// SYSTEM extension that has been installed in the same prefix as the shell
let schemaDir = extension.dir.get_child('schemas');
let schemaSource;
- if (schemaDir.query_exists(null))
+ if (schemaDir.query_exists(null)) {
schemaSource = GioSSS.new_from_directory(schemaDir.get_path(),
GioSSS.get_default(),
false);
- else
+ } else {
schemaSource = GioSSS.get_default();
+ }
let schemaObj = schemaSource.lookup(schema, true);
if (!schemaObj)
if (wmClass != null)
windowsList[windowId]['wm-class'] = GLib.Variant.new('s', wmClass);
- if (sandboxedAppId != null)
+ if (sandboxedAppId != null) {
windowsList[windowId]['sandboxed-app-id'] =
GLib.Variant.new('s', sandboxedAppId);
+ }
}
}
invocation.return_value(new GLib.Variant('(a{ta{sv}})', [windowsList]));
// @params and @defaults
function parse(params = {}, defaults, allowExtras) {
if (!allowExtras) {
- for (let prop in params)
+ for (let prop in params) {
if (!(prop in defaults))
throw new Error(`Unrecognized parameter "${prop}"`);
+ }
}
let defaultsCopy = Object.assign({}, defaults);
_updateOrientationLock() {
let available = false;
- if (this._sensorProxy.g_name_owner)
+ if (this._sensorProxy.g_name_owner) {
available = this._sensorProxy.HasAccelerometer &&
this._monitorManager.get_is_builtin_display_on();
+ }
this._actions.get(LOCK_ORIENTATION_ACTION_ID).available = available;
let results = [];
- for (let [key, { available, keywords }] of this._actions)
+ for (let [key, { available, keywords }] of this._actions) {
if (available && terms.every(t => keywords.some(k => k.startsWith(t))))
results.push(key);
+ }
return results;
}
if (minutesAgo < 5)
return _("Just now");
- if (hoursAgo < 1)
+ if (hoursAgo < 1) {
return Gettext.ngettext("%d minute ago",
"%d minutes ago", minutesAgo).format(minutesAgo);
- if (daysAgo < 1)
+ }
+ if (daysAgo < 1) {
return Gettext.ngettext("%d hour ago",
"%d hours ago", hoursAgo).format(hoursAgo);
+ }
if (daysAgo < 2)
return _("Yesterday");
- if (daysAgo < 15)
+ if (daysAgo < 15) {
return Gettext.ngettext("%d day ago",
"%d days ago", daysAgo).format(daysAgo);
- if (weeksAgo < 8)
+ }
+ if (weeksAgo < 8) {
return Gettext.ngettext("%d week ago",
"%d weeks ago", weeksAgo).format(weeksAgo);
- if (yearsAgo < 1)
+ }
+ if (yearsAgo < 1) {
return Gettext.ngettext("%d month ago",
"%d months ago", monthsAgo).format(monthsAgo);
+ }
return Gettext.ngettext("%d year ago",
"%d years ago", yearsAgo).format(yearsAgo);
}
let config = WINDOW_CONFIGS[i / 2];
yield Scripting.destroyTestWindows();
- for (let k = 0; k < config.count; k++)
+ for (let k = 0; k < config.count; k++) {
yield Scripting.createTestWindow({ width: config.width,
height: config.height,
alpha: config.alpha,
maximized: config.maximized });
+ }
yield Scripting.waitTestWindows();
yield Scripting.sleep(1000);
size = WINDOW_PREVIEW_SIZE;
this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
- if (this.app)
+ if (this.app) {
this._icon.add_actor(this._createAppIcon(this.app,
APP_ICON_SIZE_SMALL));
+ }
break;
case AppIconMode.APP_ICON_ONLY:
}
function _listsIntersect(a, b) {
- for (let itemA of a)
+ for (let itemA of a) {
if (b.includes(itemA))
return true;
+ }
return false;
}
super.animateSwitch(animationDirection);
if (this._currentPopup && this._displayingPopup &&
- animationDirection == IconGrid.AnimationDirection.OUT)
+ animationDirection == IconGrid.AnimationDirection.OUT) {
this._currentPopup.ease({
opacity: 0,
duration: VIEWS_SWITCH_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => (this.opacity = 255)
});
+ }
if (animationDirection == IconGrid.AnimationDirection.OUT)
this._pageIndicators.animateIndicators(animationDirection);
w => !w.skip_taskbar
);
- if (windows.length > 0)
+ if (windows.length > 0) {
this.addMenuItem(
/* Translators: This is the heading of a list of open windows */
new PopupMenu.PopupSeparatorMenuItem(_("Open Windows"))
);
+ }
windows.forEach(window => {
let title = window.title
});
this.contentLayout.add_child(this._selectionBox);
- if (Main.sessionMode.allowSettings)
+ if (Main.sessionMode.allowSettings) {
this.addButton({ action: this._openSettings.bind(this),
label: _("Sound Settings") });
+ }
this.addButton({ action: this.close.bind(this),
label: _("Cancel"),
key: Clutter.KEY_Escape });
let clickAction = new Clutter.ClickAction();
clickAction.connect('long-press', (action, theActor, state) => {
- if (state == Clutter.LongPressState.QUERY)
+ if (state == Clutter.LongPressState.QUERY) {
return ((action.get_button() == 0 ||
action.get_button() == 1) &&
!actor._backgroundMenu.isOpen);
+ }
if (state == Clutter.LongPressState.ACTIVATE) {
let [x, y] = action.get_coords();
openMenu(x, y);
if (this._overdriveStart == value)
return;
- if (value > this._maxValue)
+ if (value > this._maxValue) {
throw new Error(`Tried to set overdrive value to ${value}, ` +
`which is a number greater than the maximum allowed value ${this._maxValue}`);
+ }
this._overdriveStart = value;
this.notify('overdrive-start');
}
_getIcon() {
- if (this.notification.gicon)
+ if (this.notification.gicon) {
return new St.Icon({ gicon: this.notification.gicon,
icon_size: MESSAGE_ICON_SIZE });
- else
+ } else {
return this.notification.source.createIcon(MESSAGE_ICON_SIZE);
+ }
}
_onUpdated(n, _clear) {
let dayFormat;
let now = new Date();
- if (sameYear(this._date, now))
+ if (sameYear(this._date, now)) {
/* Translators: Shown on calendar heading when selected day occurs on current year */
dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
"%A, %B %-d"));
- else
+ } else {
/* Translators: Shown on calendar heading when selected day occurs on different year */
dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
"%A, %B %-d, %Y"));
+ }
this._title.label = this._date.toLocaleFormat(dayFormat);
}
if (this._tracked === shouldTrack)
return;
- if (shouldTrack)
+ if (shouldTrack) {
Main.layoutManager.trackChrome(this._dialog,
{ affectsInputRegion: true });
- else
+ } else {
Main.layoutManager.untrackChrome(this._dialog);
+ }
// The buttons are broken when they aren't added to the input region,
// so disable them properly in that case
validate: this._validateStaticWep, password: true });
break;
case 'ieee8021x':
- if (wirelessSecuritySetting.auth_alg == 'leap') // Cisco LEAP
+ if (wirelessSecuritySetting.auth_alg == 'leap') { // Cisco LEAP
secrets.push({ label: _("Password: "), key: 'leap-password',
value: wirelessSecuritySetting.leap_password || '', password: true });
- else // Dynamic (IEEE 802.1x) WEP
+ } else { // Dynamic (IEEE 802.1x) WEP
this._get8021xSecrets(secrets);
+ }
break;
case 'wpa-eap':
this._get8021xSecrets(secrets);
/* If hints were given we know exactly what we need to ask */
if (this._settingName == "802-1x" && this._hints.length) {
- if (this._hints.includes('identity'))
+ if (this._hints.includes('identity')) {
secrets.push({ label: _("Username: "), key: 'identity',
value: ieee8021xSetting.identity || '', password: false });
- if (this._hints.includes('password'))
+ }
+ if (this._hints.includes('password')) {
secrets.push({ label: _("Password: "), key: 'password',
value: ieee8021xSetting.password || '', password: true });
- if (this._hints.includes('private-key-password'))
+ }
+ if (this._hints.includes('private-key-password')) {
secrets.push({ label: _("Private key password: "), key: 'private-key-password',
value: ieee8021xSetting.private_key_password || '', password: true });
+ }
return;
}
return;
}
- if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT)
+ if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT) {
this._approveTextChannel(account, conn, channel, dispatchOp, context);
- else
+ } else {
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
message: 'Unsupported channel type' }));
+ }
}
_approveTextChannel(account, conn, channel, dispatchOp, context) {
_updateAvatarIcon() {
this.iconUpdated();
- if (this._notifiction)
+ if (this._notifiction) {
this._notification.update(this._notification.title,
this._notification.bannerBodyText,
{ gicon: this.getIcon() });
+ }
}
open() {
}
_presenceChanged(_contact, _presence, _status, _message) {
- if (this._notification)
+ if (this._notification) {
this._notification.update(this._notification.title,
this._notification.bannerBodyText,
{ secondaryGIcon: this.getSecondaryIcon() });
+ }
}
_pendingRemoved(channel, message) {
styles.push('chat-action');
}
- if (message.direction == NotificationDirection.RECEIVED)
+ if (message.direction == NotificationDirection.RECEIVED) {
this.update(this.source.title, messageBody,
{ datetime: GLib.DateTime.new_from_unix_local(message.timestamp),
bannerMarkup: true });
+ }
let group = (message.direction == NotificationDirection.RECEIVED
? 'received' : 'sent');
iconName = 'video-display-symbolic';
} else {
let app = windowTracker.get_window_app(windows[i]);
- if (app)
+ if (app) {
icon = app.create_icon_texture(POPUP_APPICON_SIZE);
- else
+ } else {
icon = textureCache.bind_cairo_surface_property(windows[i],
'icon',
POPUP_APPICON_SIZE);
+ }
}
items.push({ name: windows[i].title,
}
}
- for (let i = 0; i < addedItems.length; i++)
+ for (let i = 0; i < addedItems.length; i++) {
this._box.insert_child_at_index(addedItems[i].item,
addedItems[i].pos);
+ }
for (let i = 0; i < removedActors.length; i++) {
let item = removedActors[i];
}
if (this._grid.get_n_children() > 1) {
- if (!this._clockNotifyId)
+ if (!this._clockNotifyId) {
this._clockNotifyId =
this._clock.connect('notify::clock', this._updateLabels.bind(this));
+ }
this._updateLabels();
} else {
if (this._clockNotifyId)
}
function removeDragMonitor(monitor) {
- for (let i = 0; i < dragMonitors.length; i++)
+ for (let i = 0; i < dragMonitors.length; i++) {
if (dragMonitors[i] == monitor) {
dragMonitors.splice(i, 1);
return;
}
+ }
}
var _Draggable = class _Draggable {
};
for (let i = 0; i < dragMonitors.length; i++) {
let dropFunc = dragMonitors[i].dragDrop;
- if (dropFunc)
+ if (dropFunc) {
switch (dropFunc(dropEvent)) {
case DragDropResult.FAILURE:
case DragDropResult.SUCCESS:
case DragDropResult.CONTINUE:
continue;
}
+ }
}
// At this point it is too late to cancel a drag by destroying
continue;
let sessionId = GLib.getenv('XDG_SESSION_ID');
- if (!sessionId)
+ if (!sessionId) {
this._loginManager.getCurrentSessionProxy(currentSessionProxy => {
sessionId = currentSessionProxy.Id;
log(`endSessionDialog: No XDG_SESSION_ID, fetched from logind: ${sessionId}`);
});
+ }
if (proxy.Id == sessionId)
continue;
}
function _patchLayoutClass(layoutClass, styleProps) {
- if (styleProps)
+ if (styleProps) {
layoutClass.prototype.hookup_style = function (container) {
container.connect('style-changed', () => {
let node = container.get_theme_node();
}
});
};
+ }
}
function _makeEaseCallback(params, cleanup) {
this._preeditText.text = text.get_text();
let attrs = text.get_attributes();
- if (attrs)
+ if (attrs) {
this._setTextAttributes(this._preeditText.clutter_text,
attrs);
+ }
});
panelService.connect('show-preedit-text', () => {
this._preeditText.show();
_setTextAttributes(clutterText, ibusAttrList) {
let attr;
- for (let i = 0; (attr = ibusAttrList.get(i)); ++i)
+ for (let i = 0; (attr = ibusAttrList.get(i)); ++i) {
if (attr.get_attr_type() == IBus.AttrType.BACKGROUND)
clutterText.set_selection(attr.get_start_index(), attr.get_end_index());
+ }
}
});
}
animatePulse(animationDirection) {
- if (animationDirection != AnimationDirection.IN)
+ if (animationDirection != AnimationDirection.IN) {
throw new GObject.NotImplementedError("Pulse animation only implements " +
"'in' animation direction");
+ }
this._resetAnimationActors();
this._updateSpacingForSize(availWidth, availHeight);
}
- if (!this._updateIconSizesLaterId)
+ if (!this._updateIconSizesLaterId) {
this._updateIconSizesLaterId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
this._updateIconSizes.bind(this));
+ }
}
// Note that this is ICON_SIZE as used by BaseIcon, not elsewhere in IconGrid; it's a bit messed up
let contentParams = { icon, title };
let restoreAccel = this._getRestoreAccel();
- if (restoreAccel)
+ if (restoreAccel) {
contentParams.subtitle =
/* Translators: %s is a keyboard shortcut like "Super+x" */
_("You can restore shortcuts by pressing %s.").format(restoreAccel);
+ }
let content = new Dialog.MessageDialogContent(contentParams);
this._dialog.contentLayout.add_actor(content);
this._connectSignal(global.stage, 'notify::key-focus',
this._onKeyFocusChanged.bind(this));
- if (Meta.is_wayland_compositor())
+ if (Meta.is_wayland_compositor()) {
this._connectSignal(this._keyboardController, 'emoji-visible',
this._onEmojiKeyVisible.bind(this));
+ }
this._relayout();
}
this.monitors = [];
let nMonitors = display.get_n_monitors();
- for (let i = 0; i < nMonitors; i++)
+ for (let i = 0; i < nMonitors; i++) {
this.monitors.push(new Monitor(i,
display.get_monitor_geometry(i),
display.get_monitor_scale(i)));
+ }
if (nMonitors == 0) {
this.primaryIndex = this.bottomIndex = -1;
if (this._startingUp)
return;
- if (!this._updateRegionIdle)
+ if (!this._updateRegionIdle) {
this._updateRegionIdle = Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
this._updateRegions.bind(this));
+ }
}
_getWindowActorsForWorkspace(workspace) {
}
_updateScreenPosition() {
- if (this._screenPosition == GDesktopEnums.MagnifierScreenPosition.NONE)
+ if (this._screenPosition == GDesktopEnums.MagnifierScreenPosition.NONE) {
this._setViewPort({
x: this._viewPortX,
y: this._viewPortY,
width: this._viewPortWidth,
height: this._viewPortHeight
});
- else
+ } else {
this.setScreenPosition(this._screenPosition);
+ }
}
_updateFocus(caller, event) {
// If in lens mode, move the magnified view such that it is centered
// over the actual mouse. However, in full screen mode, the "lens" is
// the size of the screen -- pointless to move such a large lens around.
- if (this._lensMode && !this._isFullScreen())
+ if (this._lensMode && !this._isFullScreen()) {
this._setViewPort({ x: this._xCenter - this._viewPortWidth / 2,
y: this._yCenter - this._viewPortHeight / 2,
width: this._viewPortWidth,
height: this._viewPortHeight }, true);
+ }
this._updateCloneGeometry();
this._updateMousePosition();
findPos = i;
}
if (findPos != -1) {
- for (let i = 0; i < this._urls.length; i++)
+ for (let i = 0; i < this._urls.length; i++) {
if (findPos >= this._urls[i].pos &&
this._urls[i].pos + this._urls[i].url.length > findPos)
return i;
+ }
}
return -1;
}
if (this._container == container)
return;
- if (this._container)
+ if (this._container) {
for (let id of this._signals)
this._container.disconnect(id);
+ }
this._container = container;
this._signals = [];
- if (this._container)
+ if (this._container) {
for (let signal of ['notify::scale-x', 'notify::scale-y']) {
let id = this._container.connect(signal, () => {
this.layout_changed();
});
this._signals.push(id);
}
+ }
}
vfunc_get_preferred_width(container, forHeight) {
}
destroyNonResidentNotifications() {
- for (let i = this.notifications.length - 1; i >= 0; i--)
+ for (let i = this.notifications.length - 1; i >= 0; i--) {
if (!this.notifications[i].resident)
this.notifications[i].destroy();
+ }
}
});
this._trackArtists = metadata['xesam:artist'];
if (!Array.isArray(this._trackArtists) ||
!this._trackArtists.every(artist => typeof artist === 'string')) {
- if (typeof this._trackArtists !== 'undefined')
+ if (typeof this._trackArtists !== 'undefined') {
log(`Received faulty track artist metadata from ${
this._busName}; expected an array of strings, got ${
this._trackArtists} (${typeof this._trackArtists})`);
+ }
this._trackArtists = [_("Unknown artist")];
}
this._trackTitle = metadata['xesam:title'];
if (typeof this._trackTitle !== 'string') {
- if (typeof this._trackTitle !== 'undefined')
+ if (typeof this._trackTitle !== 'undefined') {
log(`Received faulty track title metadata from ${
this._busName}; expected a string, got ${
this._trackTitle} (${typeof this._trackTitle})`);
+ }
this._trackTitle = _("Unknown title");
}
this._trackCoverUrl = metadata['mpris:artUrl'];
if (typeof this._trackCoverUrl !== 'string') {
- if (typeof this._trackCoverUrl !== 'undefined')
+ if (typeof this._trackCoverUrl !== 'undefined') {
log(`Received faulty track cover art metadata from ${
this._busName}; expected a string, got ${
this._trackCoverUrl} (${typeof this._trackCoverUrl})`);
+ }
this._trackCoverUrl = '';
}
if (actions.length) {
for (let i = 0; i < actions.length - 1; i += 2) {
let [actionId, label] = [actions[i], actions[i + 1]];
- if (actionId == 'default')
+ if (actionId == 'default') {
hasDefaultAction = true;
- else
+ } else {
notification.addAction(label, () => {
this._emitActionInvoked(ndata.id, actionId);
});
+ }
}
}
else
this.useNotificationIcon = true;
- if (sender)
+ if (sender) {
this._nameWatcherId = Gio.DBus.session.watch_name(sender,
Gio.BusNameWatcherFlags.NONE,
null,
this._onNameVanished.bind(this));
- else
+ } else {
this._nameWatcherId = 0;
+ }
}
_createPolicy() {
setLevel(value) {
this._level.visible = (value != undefined);
if (value != undefined) {
- if (this.visible)
+ if (this.visible) {
this._level.ease_property('value', value, {
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: LEVEL_ANIMATION_TIME
});
- else
+ } else {
this._level.value = value;
+ }
}
}
function getRtlSlideDirection(direction, actor) {
let rtl = (actor.text_direction == Clutter.TextDirection.RTL);
- if (rtl)
+ if (rtl) {
direction = (direction == SlideDirection.LEFT)
? SlideDirection.RIGHT : SlideDirection.LEFT;
-
+ }
return direction;
}
if (focusedApp && focusedApp.is_on_workspace(workspace))
return focusedApp;
- for (let i = 0; i < this._startingApps.length; i++)
+ for (let i = 0; i < this._startingApps.length; i++) {
if (this._startingApps[i].is_on_workspace(workspace))
return this._startingApps[i];
+ }
return null;
}
vfunc_event(event) {
if (event.type() == Clutter.EventType.TOUCH_END ||
- event.type() == Clutter.EventType.BUTTON_RELEASE)
+ event.type() == Clutter.EventType.BUTTON_RELEASE) {
if (Main.overview.shouldToggleByCornerOrButton())
Main.overview.toggle();
+ }
return Clutter.EVENT_PROPAGATE;
}
cr.setOperator(Cairo.Operator.SOURCE);
cr.moveTo(0, offsetY);
- if (this._side == St.Side.LEFT)
+ if (this._side == St.Side.LEFT) {
cr.arc(cornerRadius,
borderWidth + cornerRadius,
cornerRadius, Math.PI, 3 * Math.PI / 2);
- else
+ } else {
cr.arc(0,
borderWidth + cornerRadius,
cornerRadius, 3 * Math.PI / 2, 2 * Math.PI);
+ }
cr.lineTo(cornerRadius, offsetY);
cr.closePath();
};
function isPopupMenuItemVisible(child) {
- if (child._delegate instanceof PopupMenuSection)
+ if (child._delegate instanceof PopupMenuSection) {
if (child._delegate.isEmpty())
return false;
+ }
return child.visible;
}
global.focus_manager.add_group(this.actor);
this.actor.reactive = true;
- if (this.sourceActor)
+ if (this.sourceActor) {
this._keyPressId = this.sourceActor.connect('key-press-event',
this._onKeyPress.bind(this));
+ }
this._openedSubMenu = null;
}
this._animateArrows();
}
- if (!this._arrowWatchId)
+ if (!this._arrowWatchId) {
this._arrowWatchId = this.idleMonitor.add_idle_watch(ARROW_IDLE_TIME,
this._pauseArrowAnimation.bind(this));
+ }
}
_pauseArrowAnimation() {
activate() {
this.provider.activateResult(this.metaInfo.id, this._resultsView.terms);
- if (this.metaInfo.clipboardText)
+ if (this.metaInfo.clipboardText) {
St.Clipboard.get_default().set_text(
St.ClipboardType.CLIPBOARD, this.metaInfo.clipboardText);
+ }
Main.overview.toggle();
}
});
provider.searchInProgress = true;
let previousProviderResults = previousResults[provider.id];
- if (this._isSubSearch && previousProviderResults)
+ if (this._isSubSearch && previousProviderResults) {
provider.getSubsearchResultSet(previousProviderResults,
this._terms,
results => {
this._gotResults(results, provider);
},
this._cancellable);
- else
+ } else {
provider.getInitialResultSet(this._terms,
results => {
this._gotResults(results, provider);
},
this._cancellable);
+ }
});
this._updateSearchProgress();
let loop = new GLib.MainLoop(null, false);
let id = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
let names = Object.getOwnPropertyNames(_modes);
- for (let i = 0; i < names.length; i++)
+ for (let i = 0; i < names.length; i++) {
if (_modes[names[i]].isPrimary)
print(names[i]);
+ }
loop.quit();
});
GLib.Source.set_name_by_id(id, '[gnome-shell] listModes');
_sync() {
let params = _modes[this.currentMode];
let defaults;
- if (params.parentMode)
+ if (params.parentMode) {
defaults = Params.parse(_modes[params.parentMode],
_modes[DEFAULT_MODE]);
- else
+ } else {
defaults = _modes[DEFAULT_MODE];
+ }
params = Params.parse(params, defaults);
// A simplified version of Lang.copyProperties, handles
_onOpenDisksButton() {
let app = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
- if (app)
+ if (app) {
app.activate();
- else
+ } else {
Main.notifyError(
/* Translators: %s is the Disks application */
_("Unable to start %s").format(app.get_name()),
/* Translators: %s is the Disks application */
_("Couldn’t find the %s application").format(app.get_name())
);
+ }
this._onCancelButton();
}
});
_buildItemExtended(string, initialValue, writable, onSet) {
let widget = new PopupMenu.PopupSwitchMenuItem(string, initialValue);
- if (!writable)
+ if (!writable) {
widget.reactive = false;
- else
+ } else {
widget.connect('toggled', item => {
onSet(item.state);
});
+ }
return widget;
}
initialSetting,
settings.is_writable(KEY_TEXT_SCALING_FACTOR),
enabled => {
- if (enabled)
+ if (enabled) {
settings.set_double(
KEY_TEXT_SCALING_FACTOR, DPI_FACTOR_LARGE);
- else
+ } else {
settings.reset(KEY_TEXT_SCALING_FACTOR);
+ }
});
settings.connect(`changed::${KEY_TEXT_SCALING_FACTOR}`, () => {
this.emit('current-source-changed', oldSource);
- for (let i = 1; i < this._mruSources.length; ++i)
+ for (let i = 1; i < this._mruSources.length; ++i) {
if (this._mruSources[i] == newSource) {
let currentSource = this._mruSources.splice(i, 1);
this._mruSources = currentSource.concat(this._mruSources);
break;
}
-
+ }
this._changePerWindowSource();
}
let mruSources = [];
for (let i = 0; i < this._mruSources.length; i++) {
- for (let j = 0; j < sourcesList.length; j++)
+ for (let j = 0; j < sourcesList.length; j++) {
if (this._mruSources[i].type == sourcesList[j].type &&
this._mruSources[i].id == sourcesList[j].id) {
mruSources = mruSources.concat(sourcesList.splice(j, 1));
break;
}
+ }
}
this._mruSources = mruSources.concat(sourcesList);
}
this._activeConnection = activeConnection;
- if (this._activeConnection)
+ if (this._activeConnection) {
this._activeConnectionChangedId = this._activeConnection.connect('notify::state',
this._connectionStateChanged.bind(this));
+ }
this._sync();
}
this._activeConnection = activeConnection;
- if (this._activeConnection)
+ if (this._activeConnection) {
this._activeConnectionChangedId = this._activeConnection.connect('vpn-state-changed',
this._connectionStateChanged.bind(this));
+ }
this._sync();
}
*/
this._enrolling = this._devicesToEnroll.length > 0;
- if (this._enrolling)
+ if (this._enrolling) {
GLib.idle_add(GLib.PRIORITY_DEFAULT,
this._enrollDevicesIdle.bind(this));
+ }
}
_enrollDevicesIdle() {
let page = new St.Bin({ child: actor });
- if (params.a11yFocus)
+ if (params.a11yFocus) {
Main.ctrlAltTabManager.addGroup(params.a11yFocus, name, a11yIcon);
- else
+ } else {
Main.ctrlAltTabManager.addGroup(actor, name, a11yIcon, {
proxy: this,
focusCallback: () => this._a11yFocusPage(page),
});
+ }
page.hide();
this.add_actor(page);
return page;
this._entry.set_secondary_icon(this._clearIcon);
- if (this._iconClickedId == 0)
+ if (this._iconClickedId == 0) {
this._iconClickedId = this._entry.connect('secondary-icon-clicked',
this.reset.bind(this));
+ }
} else {
if (this._iconClickedId > 0) {
this._entry.disconnect(this._iconClickedId);
}
_updatePorthole() {
- if (!Main.layoutManager.primaryMonitor)
+ if (!Main.layoutManager.primaryMonitor) {
this._porthole = { width: global.stage.width, height: global.stage.height,
x: global.stage.x, y: global.stage.y };
- else
+ } else {
this._porthole = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
+ }
this.queue_relayout();
}